<?php
namespace Admin\Controller;
use Common\Controller\AdminbaseController;
// +----------------------------------------------------------------------
// | Date:2016年10月17日
// +----------------------------------------------------------------------
// | Author: EK_熊<1439527494@qq.com>
// +----------------------------------------------------------------------
// | Description: 此文件作用于****
// +----------------------------------------------------------------------
class UploadFileController extends AdminbaseController{
    public function upload($ext='jpg'){
        $upload = new \Think\Upload();// 实例化上传类    
        
        $upload->maxSize   =     9999999999 ;// 设置附件上传大小    
        $upload->exts      =     array($ext);// 设置附件上传类型    
        $upload->rootPath  =       '.';
        $upload->savePath  =      '/data/upload/video/'; // 设置附件上传目录    
        $upload->saveName = array('uniqid','');
        $upload->replace = true;
        // 上传文件     
        $info   =   $upload->upload();  
        if(!$info) {// 上传错误提示错误信息     
            
            $data['info'] = $upload->getError();
            $data['status'] = 0;
        }else{// 上传成功        
            
            $data = $info;
            }
        $this->ajaxReturn($data);    
    }
}